package java920;

import java.util.Scanner;

//1、输入3个班，每班5个学生的成绩，求每个班的总分、平均分、最高分、最低分。
public class Test9 {
    public static void main(String[] args) {
        float avg = 0;
        Scanner input = new Scanner(System.in);
        for (int i = 1; i <= 3; i++) {
            int sum = 0;
            int max = 0;
            int min = 0;
            for (int j = 1; j <= 5; j++) {
                System.out.println("输入第" + i + "班第" + j + "个学生的成绩");
                int score = input.nextInt();
                sum += score;
                if (j == 1) {
                    max = min = score;
                }

                if (score < min) {
                    min = score;
                }
                if (score > max) {
                    max = score;
                }
            }
            avg = (float) sum / 2;
            System.out.println("第" + i + "班学生的总成绩为：" + sum + "平均分为：" + avg + "最高分为：" + max + "最低分为：" + min);
        }
    }
}
